package com.btpn.custody.dao.hibernate;

import org.hibernate.SessionFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.orm.hibernate3.HibernateTemplate;

import com.btpn.custody.bean.ApplicationContextProvider;
import com.btpn.custody.entity.MasterData;

public class MasterDataDAOs {

	protected HibernateTemplate template = null;

	public MasterDataDAOs() {
		
		ApplicationContext applicationContext = ApplicationContextProvider.getApplicationContext();
		if (applicationContext != null) {
			template = new HibernateTemplate((SessionFactory)applicationContext.getBean("sessionFactory"));
		}		
	}
	
	public MasterData merge(MasterData masterData) {
		template.merge(masterData);
		return masterData;
	}
}
